<extend name='./Public/Base/admin_base.html' />
<block name='script'>
	<link rel="stylesheet" href="__PUBLIC__/Admin/service_list.css"> 
</block>
<block name='content'>

<div class='container-layout'>
	<div class='line margin'>
		<div class='x9'>首页 / 项目管理 / 用户管理</div>
	</div>
	<hr>
	
	<div class='line' id='user_search'>
		<form action='service_type_sub' method='post' >

			<div class='x3 '>
					<input type='text' class='input' name='table_name' />
			</div>
			<div class='x2'>
				<input  type='button' class='button bg-sub'  value='搜索' ></button>
			</div>
		</form>
	</div>

	<div class='line margin-top margin-bottom serviceInfoControl_infoTypeSelect' id='user_type_btns'>
		<div class='float-left margin-left'><button class='button' type='all'>全部</button></div>
		<div class='float-left margin-left'><button class='button' type='1'>正常用户</button></div>
		<div class='float-left margin-left'><button class='button' type='2'>封禁用户</button></div>
	</div>

	

	<!--显示数据-->
	<div class='line'>
		<div class='x12' id='user_control_userList'></div>
	</div>


</div>


</block>

<block name='bottom'>
<script>
	$(function(){
		buttonInit();

		//点击全部用户
		$('button[type=all]').click(function(){
			sessionStorage.userType = 'all';
			buttonInit();
			get_user_list(); //获取分页信息
		});

		//点击正常用户
		$('button[type=1]').click(function(){
			sessionStorage.userType = 1;
			buttonInit();
			get_user_list(); //获取分页信息
		});

		//点击封禁用户
		$('button[type=2]').click(function(){
			sessionStorage.userType = 2;
			buttonInit();
			get_user_list(); //获取分页信息
		});
		get_user_list(); //获取分页信息


	});	



//获取分页信息
function get_user_list(){
	$.ajax({
		url:'__URL__/user_control_userList',
		data:{
			pageNow:sessionStorage.pageNow,
			userType:sessionStorage.userType
		},
		success:function(res){
			$("#user_control_userList").html(res);
		}
	});
}




//初始化用户类型按钮样式
function buttonInit(){
	sessionStorage.pageNow = 1; //切换用户类型时重置当前页码
	var userTypeAll = '';
	var userType1 = '';
	var userType2 = '';
	if(!sessionStorage.userType){
		sessionStorage.userType = 'all';
		userTypeAll = '#888';

	}else{
		switch(sessionStorage.userType){
			case 'all':
				userTypeAll = '#888';
			break;
			case '1':
				userType1 = '#888';
			break;
			case '2':
				userType2 = '#888';
			break;
			
		}
	}
	$('button[type=all]').css('background',userTypeAll);
	$('button[type=1]').css('background',userType1);
	$('button[type=2]').css('background',userType2);
}







</script>	

</block>